<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>跨域设置b.com中cookie</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <script type="text/javascript" charset="utf-8" src="http://apps.bdimg.com/libs/jquery/1.8.0/jquery.js"></script>
<body>
<button onclick="login()">提交</button>
<script type="text/javascript">
    var ssoUrls = new Array();
    ssoUrls.push("http://sso.a.com/set_cookie?domain=a.com");
    ssoUrls.push("http://sso.b.com/set_cookie?domain=b.com");
    ssoUrls.push("http://sso.c.com/set_cookie?domain=c.com");
    function login() {

        loginSuccess("mycookie");
    }
    function loginSuccess (token) {
        for (let ssoUrl of ssoUrls) {
            $.ajax({
                type:'get',
                url: ssoUrl+"&token="+token,
                dataType: "jsonp",
                jsonp: "callback",
                success: function (data) {

                }
            });
        }
    }
</script>
</body>
</html>